<!DOCTYPE html>
<html>

<head lang="en">
    <title>积分商城</title>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <link rel="stylesheet" href="/js/bootstrap-4.1.1-dist/css/bootstrap.min.css">
    <script src="/js/jquery/jquery.min.js"></script>
    <script src="/js/bootstrap-4.1.1-dist/js/bootstrap.min.js"></script>
    <link rel="stylesheet" href="/css/muList.css">
    <link rel="stylesheet" href="/css/font/css/font-awesome.min.css">
    <link rel="stylesheet" href="/css/reset.css" rel="stylesheet">
    <link rel="stylesheet" href="/css/index.css" rel="stylesheet">
    <script src="/js/plugins/jrender/jrender.min.js"></script>
    <script src="/js/common.js"></script>
    <script src="/js/queryAndBlank.js"></script>
    <script src="/js/plugins/dialog2/dialog.min.js"></script>
    <link rel="stylesheet" href="/js/plugins/dialog2/dialog.css"/>
    <style type="text/css">
        .bk{
            /*background-image: url(/upload/78.jpg);*/
            background-position: center;
            background-size:40%;
            opacity: 2;
        }
        h3{
            color: whitesmoke;
        }
        .news-detail h4{
            color: rgba(21, 14, 232, 0.86);
            font-size: 20px;
        }
        .news-detail b{
            color: #ff6a00;
        }
        h6{
            color: blue;
        }
    </style>


    <script>
        $(function () {
            $.get(baseUrl + '/stores',{currentPage:2,pageSize:5}, function (data) {
                $('#travelsCommends').renderValues(data, {
                    getHref: getHref
                });
                $('.carousel-item:first').addClass('active');
            })

            //设置当前页
            var currentPage=1;
            var pages;//总页数
            var travelArr=[];//用户存储文字的容器
            var loading=false;//标记是否正在查询
            function query() {
                if (loading){
                    return;//代表正在查询的话就停止当前查询
                }
                loading=true;//代表当前正在查询
                $.get(baseUrl+'/stores', {currentPage: currentPage}, function (data) {
                    $.merge(travelArr,data.list);//把第二个数据个到第一个
                    var json={list:travelArr};
                    $("#smaller").renderValues(json,{
                        getHref: getHref
                    });
                    pages=data.pages;
                    currentPage++;
                    loading=false;//查询完毕之后,关闭这个标志
                })
            }

            query();//默认调用一次查询

            //监听窗口滚动事件
            $(window).scroll(function () {
                //判断文本隐藏高度加上窗体的高度是否大于文本高度
                if ($(document).scrollTop()+$(window).height()>=$(document).height()) {
                    //当前页小于总页数的时候才去查询
                    if (currentPage<=pages) {
                        query();
                    }else {
                        $(document).dialog({
                            autoClose: 2000,
                            content: '已经到底了',
                        });
                    }
                }
            })
        })

    </script>


</head>
<body background="/upload/15.jpg"></body>
<!--<body background="https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=1374544523,4163346832&fm=26&gp=0.jpg"></body>-->
<body>
<div class="body">
    <input type="checkbox" id="menu">
    <div class="search-head">
        <div class="row nav-search">
            <div class="col-1">
                <a href="/index.html">
                    <span><i class="fa fa-chevron-left fa-2x "
                             style="color:white;font-size:25px;position: absolute;top: 23%;left:30%"></i></span>
                </a>
            </div>

            <div class="col-3"></div>
            <div class="col-5">
                <div class="input-group-sm search">
                    <span style="color: white;font-size: 18px;left:90%">积分商城</span>
                </div>
            </div>
            <div class="col-1">
                <a href="/mine/myList.html">
                    <i class="fa fa-shopping-cart"
                       style="color:white;font-size:25px;position: absolute;top: 23%;left: 50%">
                    </i>
                </a>
            </div>
            <div class="col-1">
                <a href="/index.html">
                    <i class="fa fa-home"
                       style="color:white;font-size:25px;position: absolute;top: 23%;left: 100%">
                    </i>
                </a>
            </div>
        </div>
    </div>
    <div class="container">
        <h6 class="module-title">推荐商品</h6>
        <div id="carouselExampleControls" class="carousel slide" data-ride="carousel">
            <div id="travelsCommends">
                <div class="carousel-inner" render-loop="list">
                    <div class="carousel-item">
                        <a render-fun="getHref" render-key="list.id" data-url="/mine/commodity.html?id=">
                            <img class="d-block w-100" render-src="list.picture" width="100%" height="200px">
                        <div class="recommend-author">
                            <img class="rounded-circle" style="width: 10%;" render-src="list.userHeadImgUrl">
                        </div>
                    </div>
                </div>
            </div>
            <a class="carousel-control-prev" href="#carouselExampleControls" role="button" data-slide="prev">
                <span class="carousel-control-prev-icon" aria-hidden="true"></span>
                <span class="sr-only"></span>
            </a>
            <a class="carousel-control-next" href="#carouselExampleControls" role="button" data-slide="next">
                <span class="carousel-control-next-icon" aria-hidden="true"></span>
                <span class="sr-only"></span>
            </a>
        </div>
        <hr>
        <h3 class="module-title" align="center" style="background-color: red">热销商品</h3>
        <hr>
        <div id="smaller">

            <div render-loop="list">
                <div style="margin-bottom: 20px">
                    <a render-fun="getHref" render-key="list.id" data-url="/mine/commodity.html?id=">
                        <div class="row news-detail">
                            <div class="col-5">
                                <img render-src="list.picture">
                            </div>
                            <div class="col-7">
                                <em><strong><h4 render-html="list.diseribe"></h4></strong></em>
                                邮寄方式:<b render-html="list.mail" ></b>
                                <span class="fl-r"><br>
                购买人数:&nbsp;<b style="font-size: 15px;" render-html="list.peoples"></b><br>
                                    所需积分:&nbsp;<b style="font-size: 15px;" render-html="list.price"></b>
                            </span>
                                <span >
                       <!-- <img src="/upload/81.jpg" alt="购物车" style="width: 30px;height: 30px" align="right" class="cart" render-key="list.id" render-fun="getId" data-count/>-->
                    </span>
                            </div>

                        </div>
                    </a>
                    <hr>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="wx_nav" id="wx_nav">
    <a href="/index.html" class="nav_index" id="nav_index">首页</a>
    <a href="myList.html" class="nav_shopcart" id="nav_shopcart">购物车</a>
    <a href="spdd.html" class="nav_me on" id="nav_me on">订单</a>
</div>
<script>

    $(function () {
        showComments();
    })

    function showComments() {
        var Mar = document.getElementsByClassName("Marquee")[0];
       /* var child_div = Mar.getElementsByTagName("div");*/
        var picH = 50;//移动高度
        var scrollstep = 10;//移动步幅,越大越快
        var scrolltime = 2;//移动频度(毫秒)越大越慢
        var stoptime = 2000;//间断时间(毫秒)
        var tmpH = 0;
        /*Mar.innerHTML += Mar.innerHTML;*/

        function start() {
            if (tmpH < picH) {
                tmpH += scrollstep;
                if (tmpH > picH) tmpH = picH;
                /*Mar.scrollTop = tmpH;*/
                setTimeout(start, scrolltime);
            } else {
                tmpH = 0;
               /* Mar.appendChild(child_div[0]);*/
               /* Mar.scrollTop = 0;*/
                setTimeout(start, stoptime);
            }
        }

        setTimeout(start, stoptime)
    }
</script>
</body>

</html>